#ifndef THREAD_POOL_H
#define THREAD_POOL_H

#include <stdint.h>
#include <stdbool.h>

/*special task means task which care about which thread run it*/
typedef void *(*task_func_t)(void *parameter);

struct thread_pool;
typedef struct thread_pool thread_pool_t;

thread_pool_t*		thread_pool_create(uint32_t thread_count);
void			    thread_pool_delete(thread_pool_t *tp);

void                thread_pool_set_thread_data(thread_pool_t *tp);
void *              thread_pool_get_thread_data(thread_pool_t *tp);

bool                thread_pool_is_idle(thread_pool_t *tp);
void			    thread_pool_start(thread_pool_t *tp);
void 			    thread_pool_stop(thread_pool_t *tp);
void                thread_pool_force_stop(thread_pool_t *tp);

int                 thread_pool_add_task_to_run(thread_pool_t *tp, task_func_t func, void *param);

#endif
